Error-Checking Constant
Open Transport provides a constant that you can use to initialize pointers to the opaque endpoint structure. You can then check that the current endpoint reference is valid before passing it to endpoint functions. The constant is defined as follows:
#define kOTInvalidEndpointRef ((EndpointRef)0)